//模块：
LArk.widget.bindClass(LArk.widget.BaseWidget.extend({
    options: {
        //弹窗
        view: {
            type: "window",
            url: "view.html",
            windowOptions: {
                width: 340,
                height: 360
            }
        },
    },
    //初始化[仅执行1次]
    create: function () {

    },
    viewWindow: null,
    drawEntity: null,
    floodControl: null,
    //每个窗口创建完成后调用
    winCreateOK: function (opt, result) {
        this.viewWindow = result;
    },
    //打开激活
    activate: function () {
        this.floodControl = new LArk.analysi.FloodByEntity(viewer);
    },
    analyDeal: function () {
        var that = this
        viewer.LArkgis.draw.deleteAll();
        viewer.LArkgis.draw.startDraw({
            type: "polygon",
            style: {
                color: "#007be6",
                opacity: 0.5,
                perPositionHeight: true,
                outline: false
            },
            success: function (entity) { //绘制成功后回调
                that.drawEntity = entity;
                haoutil.loading.show();
                //求最大、最小高度值  
                var positions = that.viewer.LArkgis.draw.getPositions(entity)
                var result = LArk.point.computePolygonHeightRange(positions, that.viewer.scene);
                that.viewWindow.minAndMaxHeight(result)
                haoutil.loading.hide();
            }
        });
    },
    clearBtn: function () {
        this.floodControl.clear();
        this.viewer.LArkgis.draw.deleteAll();
        this.drawEntity = null;
    },
    //关闭释放
    disable: function () {
        this.viewWindow = null;
    },


}));

